package org.ltt.rbac.controller;

import org.ltt.rbac.model.User;
import org.ltt.rbac.service.LoginService;
import org.ltt.rbac.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: dujun
 * @Date: 2020/6/3 16:16
 * @Version 1.0
 * @Description:登录逻辑接口
 */
@RestController
@RequestMapping("/auth")
public class LoginController {

    @Autowired
    private LoginService loginService;

    @Autowired
    private UserService userService ;

    @PostMapping("/login")
    public String login(@RequestBody User user){
        //@RequestParam String username,@RequestParam String password
//        User user = new User();
//        user.setUsername(username);
        System.out.println("用户名称： " + user.getUsername());
        loginService.login(user);
        System.out.println("登录成功!");
        return "登录成功!";
    }





}
